package cn.mihoyo.basic.util;


public class AjaxResult {
    public boolean success = true;
    public String msg = "操作成功";

    public Object getResultObj() {
        return resultObj;
    }

    public Object resultObj ;

    public static AjaxResult me() {
        return new AjaxResult();
    }

    public static AjaxResult fail() {
        return new AjaxResult().setSuccess(false).setMsg("操作失败");
    }

    public static AjaxResult fail(String msg) {
        return new AjaxResult().setSuccess(false).setMsg(msg);
    }


    public AjaxResult setSuccess(boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public AjaxResult setResultObj(Object resultObj){
        this.resultObj = resultObj;
        return this;
    }
}
